package phoenix.core.base.extensions;

import phoenix.core.PhoenixManager;
import phoenix.core.config.extensions.ConfigExt;
import phoenix.core.data_models.TestUserDataModel;
import phoenix.core.data_models.extentions.TestDataModelExt;
import phoenix.core.helpers.extensions.DBHelperExt;
import phoenix.core.helpers.extensions.LoggerHelperExt;
import phoenix.core.helpers.extensions.RandomizerHelperExt;
import phoenix.core.helpers.extensions.TestHelperExt;
import core.helpers.CronosHelper;
import core.helpers.StringHelper;

/**
 * The base class for test classes.
 */
public class TestBaseExt
{
	// PhoenixManager instance
	protected PhoenixManager manager;

	public TestBaseExt(PhoenixManager p_manager)
	{
		manager = p_manager;
	}

	/**
	 * Link method to TestDataModelExt
	 * 
	 * @return TestDataModelExt instance
	 * 
	 * @return TestDataModel instance
	 */
	public TestDataModelExt testModel()
	{
		return manager.testModel();
	}

	/**
	 * Link method to TestUserDataModel
	 * 
	 * @return TestUserDataModel instance
	 */
	public TestUserDataModel testUser()
	{
		return manager.testUser();
	}

	/**
	 * Link method to DBHelperExt
	 * 
	 * @return DBHelperExt instance
	 */
	public DBHelperExt db()
	{
		return manager.db();
	}

	/**
	 * Link method to RandomizerHelperExt
	 * 
	 * @return RandomizerHelperExt instance
	 */
	public RandomizerHelperExt randomizer()
	{
		return manager.randomizer();
	}

	/**
	 * Link method to ConfigExt
	 * 
	 * @return ConfigExt instance
	 */
	public ConfigExt config()
	{
		return manager.config();
	}

	/**
	 * Link method to LoggerHelperExt
	 * 
	 * @return LoggerHelperExt instance
	 */
	public LoggerHelperExt log()
	{
		if (manager == null)
		{
			// Initialize the PhoenixManager
			manager = new PhoenixManager();
		}

		return manager.log();
	}

	/**
	 * Link method to TestHelperExt
	 * 
	 * @return TestHelperExt instance
	 */
	public TestHelperExt test()
	{
		if (manager == null)
		{
			// Initialize the PhoenixManager
			manager = new PhoenixManager();
		}

		return manager.test();
	}

	/**
	 * Link method to String
	 * 
	 * @return String instance
	 */
	public StringHelper string()
	{
		if (manager == null)
		{
			// Initialize the PhoenixManager
			manager = new PhoenixManager();
		}
		return manager.string();
	}

	/**
	 * Link method to CronosHelper
	 * 
	 * @return CronosHelper instance
	 */
	public CronosHelper cronos()
	{
		if (manager == null)
		{
			// Initialize the PhoenixManager
			manager = new PhoenixManager();
		}
		return manager.cronos();
	}
}
